<html>
<head><meta charset="utf-8"><title>cranelift backend work · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html">cranelift backend work</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="187639393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187639393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187639393">(Feb 07 2020 at 13:38)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="133247">@bjorn3</span> -- so I keep hearing about all the great work you've been doing on a cranelift backend off in a side branch. I'm curious to hear more about the status and benefits -- i.e., we've thought that cranelift might give us "very fast" debug builds, is that true? It might be worth thinking about bringing that work in tree, no? I was pondering whether we ought to suggest a design meeting to talk it over.</p>



<a name="187640665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187640665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187640665">(Feb 07 2020 at 13:55)</a>:</h4>
<p>Currently a fair amount of programs compile and run. Unfortunately multithreaded program's don't yet work. (<a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/388" target="_blank" title="https://github.com/bjorn3/rustc_codegen_cranelift/issues/388">bjorn3/rustc_codegen_cranelift#388</a>) It is currently blocked on getting my Cranelift PR for TLS support (<a href="https://github.com/bytecodealliance/cranelift/issues/1174" target="_blank" title="https://github.com/bytecodealliance/cranelift/issues/1174">bytecodealliance/cranelift#1174</a>) merged.</p>
<p>As for the benefits: The goal is indeed to give much faster debug builds. I recently ran the debug builds of the rustc-perf suite: <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/878" target="_blank" title="https://github.com/bjorn3/rustc_codegen_cranelift/issues/878">bjorn3/rustc_codegen_cranelift#878</a>. For clean builds the improvements can be up to 60%, though it is sometimes slower (dylib loading time?) For incremental builds the build times are almost always slower, as no codegen units are stored in the incremental cache yet.</p>
<p>I am definitively interested in bringing it in tree, though I think the Cranelift PR should be merged first. A design meeting would be nice. I don't have a clear path forward apart from getting multithreading support though.</p>



<a name="187640949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187640949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187640949">(Feb 07 2020 at 13:59)</a>:</h4>
<blockquote>
<p>work you've been doing on a cranelift backend off in a side branch.</p>
</blockquote>
<p>I am actually developing it in a separate repo without any relation to rust-lang/rust (bjorn3/rustc_codegen_cranelift). I use the hotplug codegen backend api to load it into an unmodified rustc. This saves me a lot of compilation time and rebase work.</p>



<a name="187642716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187642716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187642716">(Feb 07 2020 at 14:20)</a>:</h4>
<p>That's awesome</p>



<a name="187643217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187643217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187643217">(Feb 07 2020 at 14:27)</a>:</h4>
<p>I wonder if <span class="user-mention silent" data-user-id="133247">bjorn3</span> and me could one day accidentally create an alternative Rust universe that doesn't use rustc...</p>



<a name="187645798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187645798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187645798">(Feb 07 2020 at 14:57)</a>:</h4>
<p>one that lazily JIT-compiles each function separately as it's being run? <span aria-label="dream" class="emoji emoji-1f4ad" role="img" title="dream">:dream:</span></p>



<a name="187648849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187648849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187648849">(Feb 07 2020 at 15:27)</a>:</h4>
<blockquote>
<p>one that lazily JIT-compiles each function separately as it's being run? <span aria-label="dream" class="emoji emoji-1f4ad" role="img" title="dream">:dream:</span></p>
</blockquote>
<p>That shouldn't be too hard. cg_clif already has JIT support. It does currently compile all functions at the same time, but it should be possible to compile everything lazy. Maybe I will implement it today :)</p>



<a name="187649153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/187649153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#187649153">(Feb 07 2020 at 15:30)</a>:</h4>
<p>I think the rest of the compiler isn't quite lazy enough yet, but that's already pretty awesome :)</p>



<a name="188026534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188026534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188026534">(Feb 12 2020 at 16:28)</a>:</h4>
<p>/me is trying to implement this lazy jit compilation, but gdb got a SIGSEGV :(</p>



<a name="188027228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188027228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188027228">(Feb 12 2020 at 16:34)</a>:</h4>
<p>I know at least something that I did wrong, but still gdb should not crash.</p>



<a name="188027302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188027302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188027302">(Feb 12 2020 at 16:34)</a>:</h4>
<p>I tried to find a debug package for gdb to get a useful backtrace, but the latest is for debian jessie.</p>



<a name="188027339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188027339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188027339">(Feb 12 2020 at 16:35)</a>:</h4>
<p>This is all I got:</p>
<div class="codehilite"><pre><span></span>#0  0x000055555584f857 in ?? ()
#1  0x0000555555851d52 in ?? ()
#2  0x000055555585170f in ?? ()
#3  0x000055555585170f in ?? ()
#4  0x000055555570ca2d in ?? ()
#5  0x000055555570cabe in ?? ()
#6  0x000055555561d8d3 in ?? ()
#7  0x000055555574c563 in ?? ()
#8  0x000055555568b029 in linux_ptrace_test_ret_to_nx_instr ()
#9  0x00005555557ac8f5 in ?? ()
#10 0x000055555574cc42 in ?? ()
#11 0x00005555557569a5 in ?? ()
#12 0x000055555576ce4d in ?? ()
#13 0x000055555576d04f in ?? ()
#14 0x000055555576d0f5 in ?? ()
#15 0x000055555576698b in ?? ()
#16 0x00005555557635ff in ?? ()
#17 0x0000555555767b16 in ?? ()
#18 0x00005555555ec898 in ?? ()
#19 0x00007ffff735509b in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#20 0x00005555555ed48a in ?? ()
</pre></div>



<a name="188033353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188033353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188033353">(Feb 12 2020 at 17:34)</a>:</h4>
<p>I now got it working a bit. It now <em>only</em> crashes after a few calls.</p>



<a name="188035149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188035149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188035149">(Feb 12 2020 at 17:50)</a>:</h4>
<p>I think I found the problem: I didn't implement returning from the function shim yet.</p>



<a name="188035373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188035373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188035373">(Feb 12 2020 at 17:53)</a>:</h4>
<p><span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>
<div class="codehilite"><pre><span></span>Rustc codegen cranelift will JIT run the executable, because the SHOULD_RUN env var is set
New Instance { def: Item(DefId(0:34 ~ mini_core_hello_world[317d]::start[0])), substs: [()] } @ 0x7f110d0a6000
New Instance { def: Item(DefId(0:51 ~ mini_core_hello_world[317d]::main[0])), substs: [] } @ 0x7f110d190000
New Instance { def: Item(DefId(0:48 ~ mini_core_hello_world[317d]::take_unique[0])), substs: [] } @ 0x7f110d17e000
New Instance { def: Item(DefId(0:47 ~ mini_core_hello_world[317d]::take_f32[0])), substs: [] } @ 0x7f110d183000
New Instance { def: Item(DefId(0:50 ~ mini_core_hello_world[317d]::call_return_u128_pair[0])), substs: [] } @ 0x7f110d195000
New Instance { def: Item(DefId(0:49 ~ mini_core_hello_world[317d]::return_u128_pair[0])), substs: [] } @ 0x7f110d19a000
Hello printf
Hello
World!
New Instance { def: DropGlue(DefId(1:228 ~ mini_core[8787]::drop_in_place[0]), Some(mini_core::Box&lt;dyn SomeTrait&gt;)), substs: [mini_core::Box&lt;dyn SomeTrait&gt;] } @ 0x7f110d19f000
New Instance { def: DropGlue(DefId(1:228 ~ mini_core[8787]::drop_in_place[0]), None), substs: [&amp;str] } @ 0x7f110d1a4000
New Instance { def: Item(DefId(1:248 ~ mini_core[8787]::box_free[0])), substs: [dyn SomeTrait] } @ 0x7f110d1a9000
New Instance { def: Item(DefId(0:12 ~ mini_core_hello_world[317d]::{{impl}}[1]::object_safe[0])), substs: [] } @ 0x7f110d1ae000
abc
New Instance { def: Item(DefId(0:61 ~ mini_core_hello_world[317d]::main[0]::zeroed[0])), substs: [(u8, u8)] } @ 0x7f110d1b3000
Existing @ 0x7f110d19f000
New Instance { def: DropGlue(DefId(1:228 ~ mini_core[8787]::drop_in_place[0]), Some(NoisyDrop)), substs: [NoisyDrop] } @ 0x7f110cc3c000
New Instance { def: Item(DefId(0:19 ~ mini_core_hello_world[317d]::{{impl}}[2]::drop[0])), substs: [] } @ 0x7f110cc41000
Boxed outer got dropped!
New Instance { def: DropGlue(DefId(1:228 ~ mini_core[8787]::drop_in_place[0]), Some(NoisyDropInner)), substs: [NoisyDropInner] } @ 0x7f110cc46000
New Instance { def: Item(DefId(0:21 ~ mini_core_hello_world[317d]::{{impl}}[3]::drop[0])), substs: [] } @ 0x7f110cc4b000
Inner got dropped!
Existing @ 0x7f110d1a9000
New Instance { def: DropGlue(DefId(1:228 ~ mini_core[8787]::drop_in_place[0]), Some([NoisyDropInner; 2])), substs: [[NoisyDropInner; 2]] } @ 0x7f110cc55000
Existing @ 0x7f110cc4b000
Inner got dropped!
Existing @ 0x7f110cc4b000
Inner got dropped!
New Instance { def: ClosureOnceShim { call_once: DefId(1:222 ~ mini_core[8787]::FnOnce[0]::call_once[0]) }, substs: [[closure@example/mini_core_hello_world.rs:237:17: 237:28], ((),)] } @ 0x7f110cc5a000
New Instance { def: Item(DefId(0:860 ~ mini_core_hello_world[317d]::main[0]::{{closure}}[1])), substs: [i8, extern &quot;rust-call&quot; fn(((),)) -&gt; u8] } @ 0x7f110cc5f000
New Instance { def: Item(DefId(0:859 ~ mini_core_hello_world[317d]::check_niche_behavior[0])), substs: [] } @ 0x7f110d09a000
New Instance { def: Item(DefId(0:8 ~ mini_core_hello_world[317d]::{{impl}}[0]::report[0])), substs: [] } @ 0x7f110cc64000
</pre></div>



<a name="188035476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188035476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188035476">(Feb 12 2020 at 17:54)</a>:</h4>
<p>You can find it at the <code>wip_lazy_jit</code> branch.</p>



<a name="188037096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/188037096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#188037096">(Feb 12 2020 at 18:09)</a>:</h4>
<p>I hope to do some clean-up tomorrow to then create a PR.</p>



<a name="189139080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189139080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189139080">(Feb 26 2020 at 17:54)</a>:</h4>
<blockquote>
<p>I hope to do some clean-up tomorrow to then create a PR.</p>
</blockquote>
<p>Haven't done this yet, but the Cranelift TLS PR got merged today, so I was able to merge <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/784" target="_blank" title="https://github.com/bjorn3/rustc_codegen_cranelift/issues/784">bjorn3/rustc_codegen_cranelift#784</a>, which makes it possible to run multi-threaded programs.</p>



<a name="189139473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189139473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yerkebulan Tulibergenov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189139473">(Feb 26 2020 at 17:58)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> Thank you for your great work! I am so excited about the progress.<br>
Do you have a guesstimate when it will be ready to compile stuff? Or pass rustc test suite if it’s easier for you to answer?</p>



<a name="189142197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189142197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189142197">(Feb 26 2020 at 18:24)</a>:</h4>
<p>Many things already work. The rustc test suite is a hard one to fully pass, as it checks the exact error message for errors happening during codegen, it tests many unstable features not yet implemented in cg_clif and there are also tests for the exact llvm ir and asm generated. I don't have any idea how long it will take for most programs to compile, but I hope it won't be several years :)</p>



<a name="189142444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189142444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189142444">(Feb 26 2020 at 18:26)</a>:</h4>
<p>If you have any idea for an executable to test, commenting on <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/247" target="_blank" title="https://github.com/bjorn3/rustc_codegen_cranelift/issues/247">bjorn3/rustc_codegen_cranelift#247</a> is appreciated. You don't have to test if it compiles and runs.</p>



<a name="189143347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189143347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189143347">(Feb 26 2020 at 18:33)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> what if we moved the cg_clif backend into tree and then ignored certain UI tests that cranelift cannot handle yet?</p>



<a name="189143355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189143355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189143355">(Feb 26 2020 at 18:33)</a>:</h4>
<p>and then you can work on them one by one</p>



<a name="189145490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189145490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189145490">(Feb 26 2020 at 18:49)</a>:</h4>
<p>I rather like the fact that cg_clif is out of tree. It saves much disk space (no LLVM checkout and no rustc build artifacts) and it makes compilation much faster, as I can use a rustup installed nightly, instead of building it myself.</p>
<p>I do have a branch of cg_clif with the necessary commands to run the rustc test suite. It does removes the most tests depending on unimplemented features. I haven't updated it in a while, but I think I will rebase it soon.</p>



<a name="189145647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189145647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189145647">(Feb 26 2020 at 18:51)</a>:</h4>
<p>I'm sure we can mark tests as LLVM specific without moving cg_clif in-tree</p>



<a name="189145799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189145799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189145799">(Feb 26 2020 at 18:52)</a>:</h4>
<p><a href="https://github.com/bjorn3/rustc_codegen_cranelift/blob/2142b538d605b81a0176c9d11b7c77c79c4aa739/test.sh#L98" target="_blank" title="https://github.com/bjorn3/rustc_codegen_cranelift/blob/2142b538d605b81a0176c9d11b7c77c79c4aa739/test.sh#L98">https://github.com/bjorn3/rustc_codegen_cranelift/blob/2142b538d605b81a0176c9d11b7c77c79c4aa739/test.sh#L98</a></p>



<a name="189146252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189146252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189146252">(Feb 26 2020 at 18:57)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> oh but don't you want to like have CI ensure no regressions in cg_clif at some point?</p>



<a name="189146342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189146342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189146342">(Feb 26 2020 at 18:58)</a>:</h4>
<p>Marking tests which can not possibly work on non-LLVM backends, like checking llvm ir or asm output, as such makes sense to me. Marking tests that require a feature not yet implemented in cg_clif though would mean that I have to make a PR every time I implement something new.</p>



<a name="189146403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189146403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189146403">(Feb 26 2020 at 18:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="126931">centril</span> <a href="#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/189146252" title="#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/189146252">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> oh but don't you want to like have CI ensure no regressions in cg_clif at some point?</p>
</blockquote>
<p>Yes, I run <code>./test.sh</code> on Travis CI for that.</p>



<a name="189146588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189146588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189146588">(Feb 26 2020 at 19:00)</a>:</h4>
<p>Did you mean changes on the rustc side?</p>



<a name="189146758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189146758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189146758">(Feb 26 2020 at 19:02)</a>:</h4>
<p>If so, almost all breakages were either a changed api or a patch to libstd and friends not applying anymore. Any miscompilations were I believe my fault.</p>



<a name="189146866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189146866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189146866">(Feb 26 2020 at 19:03)</a>:</h4>
<p>There is just one case that a breakage was rustc's fault: printing every mir statement panicked, or rather still panics.</p>



<a name="189147043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189147043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189147043">(Feb 26 2020 at 19:04)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/67558" target="_blank" title="https://github.com/rust-lang/rust/issues/67558">#67558</a></p>



<a name="189147278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189147278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189147278">(Feb 26 2020 at 19:07)</a>:</h4>
<p>Found another: <a href="https://github.com/rust-lang/rust/issues/64872" target="_blank" title="https://github.com/rust-lang/rust/issues/64872">#64872</a>, likely wouldn't have failed if cg_clif was in-tree though</p>



<a name="189147646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189147646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189147646">(Feb 26 2020 at 19:11)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> yeah rustc side</p>



<a name="189147720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/189147720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#189147720">(Feb 26 2020 at 19:11)</a>:</h4>
<p>maybe it's too soon though</p>



<a name="190377407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190377407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190377407">(Mar 12 2020 at 11:06)</a>:</h4>
<p>I implemented incremental caching of object files yesterday. This drastically improved the results on the rustc-perf suite: <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/878#issuecomment-597871730" target="_blank" title="https://github.com/bjorn3/rustc_codegen_cranelift/issues/878#issuecomment-597871730">https://github.com/bjorn3/rustc_codegen_cranelift/issues/878#issuecomment-597871730</a> There are still cases where cg_clif is a ~30-60% regression over cg_llvm though.</p>



<a name="190385866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190385866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190385866">(Mar 12 2020 at 12:57)</a>:</h4>
<p>This is really incredible work <span class="user-mention" data-user-id="133247">@bjorn3</span>!</p>



<a name="190386830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190386830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190386830">(Mar 12 2020 at 13:06)</a>:</h4>
<p>Next step: do a run with -Zself-profile to find the cause of the remaining reds.</p>



<a name="190387288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190387288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190387288">(Mar 12 2020 at 13:11)</a>:</h4>
<p>If there's anything you need on the <code>self-profile</code> side, feel free to ping me or post in <a class="stream" data-stream-id="187831" href="/#narrow/stream/187831-t-compiler.2Fwg-self-profile">#t-compiler/wg-self-profile</a></p>



<a name="190387893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190387893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190387893">(Mar 12 2020 at 13:18)</a>:</h4>
<p>Just knowing how much time is spent during analysis vs codegen vs linking is probably enough in this case. I think the reds are partially caused by the linker having to process a larger libstd than the optimized libstd of cg_llvm. If I need anything more than that that is missing, I will post in #t-compiler/wg-self-profile.</p>



<a name="190388111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190388111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190388111">(Mar 12 2020 at 13:20)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I went ahead and added A-cranelift, <a href="https://github.com/rust-lang/rust/labels/A-cranelift" target="_blank" title="https://github.com/rust-lang/rust/labels/A-cranelift">https://github.com/rust-lang/rust/labels/A-cranelift</a></p>



<a name="190388841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190388841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190388841">(Mar 12 2020 at 13:28)</a>:</h4>
<p>Thanks!</p>



<a name="190388903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190388903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190388903">(Mar 12 2020 at 13:29)</a>:</h4>
<p>Working on sifting through the issues mentioning "cranelift" to see what to add to it <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="190389381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190389381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190389381">(Mar 12 2020 at 13:33)</a>:</h4>
<p>I have added the label to two issues.</p>



<a name="190389913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190389913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190389913">(Mar 12 2020 at 13:38)</a>:</h4>
<p>I don't think <a href="https://github.com/rust-lang/rust/issues/55993" target="_blank" title="https://github.com/rust-lang/rust/issues/55993">#55993</a> deserves the label. It isn't necessary for cg_clif, but is just deduplicating some code between rustc and Cranelift.</p>



<a name="190390114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190390114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190390114">(Mar 12 2020 at 13:40)</a>:</h4>
<p>removed that one; I've added the label to the ones I thought were relevant; have a look and see if some were erroneously added</p>



<a name="190390513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190390513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190390513">(Mar 12 2020 at 13:44)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/55931" target="_blank" title="https://github.com/rust-lang/rust/issues/55931">#55931</a> is an issue while compiling cg_clif itself, while <a href="https://github.com/rust-lang/rust/issues/69924" target="_blank" title="https://github.com/rust-lang/rust/issues/69924">#69924</a> is an issue while generating a backtrace during compilation with cg_clif. both should be reproducable without cg_clif. in the former case cg_clif is not executing, while in the later case cg_clif doesn't execute any unsafe code.</p>



<a name="190390709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190390709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190390709">(Mar 12 2020 at 13:46)</a>:</h4>
<p>ah, removed the label on those</p>



<a name="190391629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190391629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190391629">(Mar 12 2020 at 13:55)</a>:</h4>
<p>I have added the label to one more issue. I think the issue is now applied to all issues it should be applied to and not applied to issues it shouldn't be applied to.</p>



<a name="190392127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190392127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190392127">(Mar 12 2020 at 13:59)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> what wuld you think about doing a design meeting to discuss the work you've been doing on cranelift?</p>



<a name="190392139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190392139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190392139">(Mar 12 2020 at 13:59)</a>:</h4>
<p>I can think of a number of different possible focuses</p>



<a name="190392230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190392230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190392230">(Mar 12 2020 at 14:00)</a>:</h4>
<ul>
<li>learning how things work, learning more about cranelift -- that could also be a Compiler Lecture Series candidate :) (kind of let that drop off...)</li>
</ul>



<a name="190392265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190392265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190392265">(Mar 12 2020 at 14:00)</a>:</h4>
<ul>
<li>talking about how to support cranelift work -- do we want to bring in tree, for example?</li>
</ul>



<a name="190393345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190393345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190393345">(Mar 12 2020 at 14:10)</a>:</h4>
<p>I think cg_clif now supports enough programs since new multithreading support that working towards upstreaming this now makes some sense. (preferably as a submodule like miri and clippy)</p>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I am interested in a design meeting.</p>



<a name="190419425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419425">(Mar 12 2020 at 17:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Did you miss my response due to the meeting happening at the same time?</p>



<a name="190419551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419551">(Mar 12 2020 at 17:34)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I did!</p>



<a name="190419608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419608">(Mar 12 2020 at 17:34)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> can you <a href="https://github.com/rust-lang/compiler-team/issues/new?assignees=&amp;labels=meeting-proposal&amp;template=meeting-proposal.md&amp;title=%28My+meeting+proposal%29" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/new?assignees=&amp;labels=meeting-proposal&amp;template=meeting-proposal.md&amp;title=%28My+meeting+proposal%29">open a proposal</a> on compiler-team?</p>



<a name="190419618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419618">(Mar 12 2020 at 17:35)</a>:</h4>
<p>it doesn't need to be super detailed to start</p>



<a name="190419627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419627">(Mar 12 2020 at 17:35)</a>:</h4>
<p>it'd be great to do that before tomorrow though</p>



<a name="190419664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419664">(Mar 12 2020 at 17:35)</a>:</h4>
<p>ideally we'd also create a hackmd with some notes on status and some prompts for what meeting shoudl discuss, but we can hammer that out async too</p>



<a name="190419722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419722">(Mar 12 2020 at 17:35)</a>:</h4>
<p>Sure will open a proposal.</p>



<a name="190419881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419881">(Mar 12 2020 at 17:36)</a>:</h4>
<p>A submodule makes sense to start with; at some point we should consider moving everything in tree though</p>



<a name="190419923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190419923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190419923">(Mar 12 2020 at 17:37)</a>:</h4>
<p>A <code>-Z cranelift</code> flag might also make sense, both for rustc and cargo</p>



<a name="190420081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190420081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190420081">(Mar 12 2020 at 17:38)</a>:</h4>
<p>With the current infra that would be -Zcodegen-backend=cranelift</p>



<a name="190420357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190420357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190420357">(Mar 12 2020 at 17:40)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> ah; that works, maybe we can make it more convenient cargo side</p>



<a name="190420466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190420466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190420466">(Mar 12 2020 at 17:41)</a>:</h4>
<p>Sure, it would also be nice to support the jit mode in cargo</p>



<a name="190435270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190435270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190435270">(Mar 12 2020 at 19:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/190419608" title="#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/190419608">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> can you <a href="https://github.com/rust-lang/compiler-team/issues/new?assignees=&amp;labels=meeting-proposal&amp;template=meeting-proposal.md&amp;title=%28My+meeting+proposal%29" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/new?assignees=&amp;labels=meeting-proposal&amp;template=meeting-proposal.md&amp;title=%28My+meeting+proposal%29">open a proposal</a> on compiler-team?</p>
</blockquote>
<p>Is <a href="https://gist.github.com/bjorn3/d77f1b5b3cc69575295aa3f931cac053" target="_blank" title="https://gist.github.com/bjorn3/d77f1b5b3cc69575295aa3f931cac053">https://gist.github.com/bjorn3/d77f1b5b3cc69575295aa3f931cac053</a> about right?</p>



<a name="190438946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190438946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190438946">(Mar 12 2020 at 20:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I guess the above quote didn't count as a pingable mention?</p>



<a name="190448643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190448643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190448643">(Mar 12 2020 at 21:40)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> looks great :)</p>



<a name="190448651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190448651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190448651">(Mar 12 2020 at 21:40)</a>:</h4>
<p>and indeed the "quote" doesn't ping</p>



<a name="190448669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190448669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190448669">(Mar 12 2020 at 21:40)</a>:</h4>
<p>(in general you can do <code>@_**Foo**</code> to mention someone without pinging them)</p>



<a name="190449747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190449747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190449747">(Mar 12 2020 at 21:53)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/compiler-team/issues/257" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/257">rust-lang/compiler-team#257</a></p>



<a name="190450887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190450887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190450887">(Mar 12 2020 at 22:05)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I think it would be good to get some agenda items for the meeting -- e.g., one question I might want to answer is whether it makes sense to land things in-tree, so that it is CI gated and such</p>



<a name="190491877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190491877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190491877">(Mar 13 2020 at 11:18)</a>:</h4>
<p><a href="https://hackmd.io/@bjorn3/HJL5ryFS8" target="_blank" title="https://hackmd.io/@bjorn3/HJL5ryFS8">https://hackmd.io/@bjorn3/HJL5ryFS8</a></p>



<a name="190492427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/190492427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#190492427">(Mar 13 2020 at 11:26)</a>:</h4>
<p>Feedback is welcome</p>



<a name="213355483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213355483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213355483">(Oct 14 2020 at 21:58)</a>:</h4>
<p>Hey! <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> Do we imagine adding a cranelift backend for rustc having any implications for supporting portable SIMD? It’s currently being built out-of-tree on LLVM intrinsics. cc <span class="user-mention" data-user-id="224471">@Lokathor</span> <span class="user-mention" data-user-id="281757">@Jubilee</span></p>



<a name="213355875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213355875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213355875">(Oct 14 2020 at 22:02)</a>:</h4>
<p>Oh the entire library back end would need to be rebuilt</p>



<a name="213355897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213355897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213355897">(Oct 14 2020 at 22:02)</a>:</h4>
<p>the public api would be the same</p>



<a name="213357716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213357716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213357716">(Oct 14 2020 at 22:24)</a>:</h4>
<p>The <code>simd_*</code> platform-intrinsics are already implemented/emulated in cg_clif as well as a subset of the llvm intrinsics used by the regex crate, the rand crate and their dependencies.</p>



<a name="213357876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213357876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213357876">(Oct 14 2020 at 22:26)</a>:</h4>
<p>Patching the sysroot has been a pain because of having to update the patches regularly. I am glad I don't have to anymore.</p>



<a name="213357907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213357907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213357907">(Oct 14 2020 at 22:26)</a>:</h4>
<p>Would portable SIMD end up effectively “racing” with the cranelift backend if one introduces a significant amount of work for the other?</p>



<a name="213358101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213358101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213358101">(Oct 14 2020 at 22:29)</a>:</h4>
<p>I hope most if not all of the operations used by portable simd could use (newly introduced) <code>simd_*</code> platform intrinsics that are architecture and vector size independent. This would allow easy emulation of them implemented once per operation.</p>



<a name="213358331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/213358331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#213358331">(Oct 14 2020 at 22:31)</a>:</h4>
<p>Thanks! :slight_smile: Sounds like it’s at least on Portable SIMD to find out so I’ll move discussion back over to <a class="stream" data-stream-id="257879" href="/#narrow/stream/257879-project-portable-simd">#project-portable-simd</a> <span aria-label="bow" class="emoji emoji-1f647" role="img" title="bow">:bow:</span></p>



<a name="214627955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214627955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214627955">(Oct 26 2020 at 20:21)</a>:</h4>
<p><span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> <a href="https://github.com/rust-lang/rust/issues/77975">#77975</a> has been merged, so you can now use <code>codegen-backends = ["llvm", "cranelift"]</code> in <code>config.toml</code> to build cg_clif as part of rustc. <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="214636452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214636452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214636452">(Oct 26 2020 at 21:36)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> Is it possible to bootstrap rustc with cranelift via the cargo.toml?</p>



<a name="214636479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214636479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214636479">(Oct 26 2020 at 21:37)</a>:</h4>
<p>actually, I guess a stage1 bootstrap won't be possible until the next beta bump</p>



<a name="214638133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214638133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214638133">(Oct 26 2020 at 21:54)</a>:</h4>
<p>Due to <a href="https://github.com/rust-lang/rust/issues/77458">#77458</a> a bootstrap using cg_clif currently fails. I have successfully bootstrapped rustc using cg_clif in the past. This is done by removing llvm from <code>codegen-backends</code> and only setting cranelift.</p>



<a name="214638264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214638264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214638264">(Oct 26 2020 at 21:55)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> cg_clif is not built by default, so stage0 can't use it even at the next vbeta bump. Only from stage1 on is it possible to bootstrap. If you set <code>full-bootstrap</code> to true, a rustc built using cg_clif will build rustc again.</p>



<a name="214640748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214640748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214640748">(Oct 26 2020 at 22:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/214638133">said</a>:</p>
<blockquote>
<p>Due to <a href="https://github.com/rust-lang/rust/issues/77458">#77458</a> a bootstrap using cg_clif currently fails. I have successfully bootstrapped rustc using cg_clif in the past. This is done by removing llvm from <code>codegen-backends</code> and only setting cranelift.</p>
</blockquote>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I think the fix for that is just to change <code>{}</code> to <code>{:?}</code>, right?</p>



<a name="214680019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214680019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214680019">(Oct 27 2020 at 10:07)</a>:</h4>
<p>Found a better solution in <a href="https://github.com/bjorn3/rustc_codegen_cranelift/commit/2be0596810bd34e4d50ecda5ad2b71f8370d7e00">https://github.com/bjorn3/rustc_codegen_cranelift/commit/2be0596810bd34e4d50ecda5ad2b71f8370d7e00</a>. cg_llvm used <code>with_no_trimmed_paths</code> for the same code.</p>



<a name="214801768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214801768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214801768">(Oct 28 2020 at 07:14)</a>:</h4>
<p>errors in <code>cg_clif</code> are reported using only <code>src/module/submodule.rs</code> instead of <code>compiler/rustc_codegen_cranelift/src/module/submodule.rs</code> which prevents my IDE from quickly jumping to the relevant file. Does one of you know why this is the case?</p>
<p>For example</p>
<div class="codehilite"><pre><span></span><code>error[E0308]: mismatched types
   --&gt; src/value_and_place.rs:486:87
    |
486 |                         .normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), from_traits);
    |                                                                                       ^^^^^^^^^^^ expected struct `Binder`, found reference
    |
    = note: expected struct `Binder&lt;_&gt;`
            found reference `&amp;Binder&lt;&amp;rustc_middle::ty::List&lt;ExistentialPredicate&lt;&#39;_&gt;&gt;&gt;`
</code></pre></div>


<p>instead of something like</p>
<div class="codehilite"><pre><span></span><code>error[E0585]: found a documentation comment that doesn&#39;t document anything
  --&gt; compiler/rustc_codegen_ssa/src/mir/mod.rs:80:5
   |
78 |     locals: IndexVec&lt;mir::Local, LocalRef&lt;&#39;tcx, Bx::Value&gt;&gt;
   |                                                            - help: missing comma here: `,`
79 |
80 |     /// All `VarDebugInfo` from the MIR body, partitioned by `Local`.
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: doc comments must come before what they document, maybe a comment was intended with `//`?
</code></pre></div>



<a name="214821244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214821244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214821244">(Oct 28 2020 at 11:05)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> cg_clif is in it's own workspace. I use profile overrides to compile all build dependencies (not just build scripts) without optimizations and compile all regular dependencies with optimizations even in debug mode (so incremental compilation is fast while making compiling using cg_clif as fast as possible) Cargo complains if you use profile overrides in a non-root crate. Also I use <code>Cargo.lock</code> to fix the cranelift dependency git version instead of a <code>rev</code> to allow for updating using only <code>cargo update -p cranelift-codegen</code>)</p>



<a name="214959956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214959956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214959956">(Oct 29 2020 at 12:38)</a>:</h4>
<p>I have just encountered the same thing. It is very hard to effectively fix breakage in <code>rustc_codegen_cranelift</code>. Can you move the overrides to the <code>Cargo.toml</code> in the root and place <code>rustc_codegen_cranelift</code> into the main workspace?</p>



<a name="214960022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960022">(Oct 29 2020 at 12:39)</a>:</h4>
<p>I can move the overrides, but then they don't apply when doing out of tree development anymore.</p>



<a name="214960193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960193">(Oct 29 2020 at 12:41)</a>:</h4>
<p>A workaround is to open <code>code compiler/rustc_codegen_cranelift</code> and then <code>cd ../..</code> within the terminal there, but it's annoying to have to switch to that.</p>
<p>I do realize the out of tree dev will get impacted by that. We have the same problem with miri and its <code>Cargo.lock</code>. I don't have a good solution for this... Not sure what to do</p>



<a name="214960363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960363">(Oct 29 2020 at 12:42)</a>:</h4>
<p>As a hack maybe the rustc wrapper of bootstrap can <code>cd ../..</code> and extend the source path passed to rustc with <code>compiler/rustc_codegen_cranelift</code> when the crate name is <code>rustc_codegen_cranelift</code>? All other paths should be absolute.</p>



<a name="214960421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960421">(Oct 29 2020 at 12:43)</a>:</h4>
<p>hmm.. the wrapper can probably invoke <code>cargo --manifest-path=compiler/rustc_codegen_cranelift/Cargo.toml</code>, which will then work out of the box I think</p>



<a name="214960487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960487">(Oct 29 2020 at 12:44)</a>:</h4>
<p>I'll experiment and see what bootstrap says</p>



<a name="214960526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960526">(Oct 29 2020 at 12:44)</a>:</h4>
<p>I don't think so. Cargo always cd's into the workspace root I think. And for <a href="http://crates.io">crates.io</a> dependencies into the respective source dir.</p>



<a name="214960575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960575">(Oct 29 2020 at 12:45)</a>:</h4>
<p>Side note, I just found</p>
<div class="codehilite"><pre><span></span><code>        // If we&#39;re building from git sources, we need to vendor a complete distribution.
        if builder.rust_info.is_git() {
            // Vendor all Cargo dependencies
            let mut cmd = Command::new(&amp;builder.initial_cargo);
            cmd.arg(&quot;vendor&quot;)
                .arg(&quot;--sync&quot;)
                .arg(builder.src.join(&quot;./src/tools/rust-analyzer/Cargo.toml&quot;))
                .arg(builder.src.join(&quot;./compiler/rustc_codegen_cranelift/Cargo.toml&quot;))
                .current_dir(&amp;plain_dst_src);
            builder.run(&amp;mut cmd);
        }
</code></pre></div>


<p>that can be removed now, right?</p>



<a name="214960597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960597">(Oct 29 2020 at 12:45)</a>:</h4>
<p>Why?</p>



<a name="214960610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960610">(Oct 29 2020 at 12:45)</a>:</h4>
<p>oh wait, this is building the dist package?</p>



<a name="214960620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/214960620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#214960620">(Oct 29 2020 at 12:45)</a>:</h4>
<p>sorry, I got confused about where I was</p>



<a name="215132004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215132004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215132004">(Oct 30 2020 at 18:16)</a>:</h4>
<p><a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/1097">bjorn3/rustc_codegen_cranelift#1097</a> is a curious bug. During rustc bootstrap it hangs, while trying to reproduce it separately causes a crash due to <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/1063">bjorn3/rustc_codegen_cranelift#1063</a>.</p>



<a name="215136469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215136469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215136469">(Oct 30 2020 at 18:54)</a>:</h4>
<p>I can't reproduce the hang outside of rustc. I already tried to run <code>"0.1".parse::&lt;Single&gt;()</code>, which should exactly be what rustc does.</p>



<a name="215136518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215136518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215136518">(Oct 30 2020 at 18:55)</a>:</h4>
<p>Running it in release mode reproduced it.</p>



<a name="215204214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215204214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215204214">(Oct 31 2020 at 18:13)</a>:</h4>
<p>/me spent all day debugging this issue. turns out it is a one line fix <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span></p>



<a name="215210513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215210513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215210513">(Oct 31 2020 at 20:26)</a>:</h4>
<p>Fixing this issue seems to fix rustc bootstrapping using cg_clif. At least now successfully builds the sysroot.</p>



<a name="215239353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215239353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215239353">(Nov 01 2020 at 11:10)</a>:</h4>
<p>I wrote a post about my debugging process to fix bootstrapping using cg_clif: <a href="https://bjorn3.github.io/2020/11/01/fixing-rustc-bootstrap-with-cg_clif.html">https://bjorn3.github.io/2020/11/01/fixing-rustc-bootstrap-with-cg_clif.html</a></p>



<a name="215251603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215251603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215251603">(Nov 01 2020 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I just tried to build the cranelift backend and it gave an ICE about <code>trimmed_def_paths</code>. I think I remember you fixing a bug like this recently - is it waiting on a subtree sync?</p>



<a name="215251664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215251664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215251664">(Nov 01 2020 at 16:40)</a>:</h4>
<p>Yes, that is one of the bugs fixed by the subtree sync.</p>



<a name="215255190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215255190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215255190">(Nov 01 2020 at 18:13)</a>:</h4>
<p>in case people are interested: <a href="https://github.com/rust-lang/blog.rust-lang.org/pull/720">https://github.com/rust-lang/blog.rust-lang.org/pull/720</a></p>



<a name="215583773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215583773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215583773">(Nov 04 2020 at 14:02)</a>:</h4>
<p>While we do not check cranelift on CI yet, will <code>./x.py test compiler/rustc_codegen_cranelift</code> test everything that you would expect to be tested?</p>



<a name="215584231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215584231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215584231">(Nov 04 2020 at 14:05)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> No, I haven't implemented testing of cg_clif in bootstrap yet. What should work is removing <code>compiler/rustc_codegen_cranelift/rust-toolchain</code>, overriding the rustc for <code>compiler/rustc_codegen_cranelift</code> or the whole rust source to the newly compiled rustc and then run <code>./test.sh</code> from <code>compiler/rustc_codegen_cranelift</code>. You may want to comment out <code>scripts/tests.sh extended_sysroot</code> in <code>test.sh</code> though. Those are some extra tests that are unlikely to fail when the rest succeeds, but take a long time.</p>



<a name="215585086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/215585086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#215585086">(Nov 04 2020 at 14:11)</a>:</h4>
<p>Thanks! I'll do some experimentation with that</p>



<a name="216826558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/216826558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#216826558">(Nov 16 2020 at 02:09)</a>:</h4>
<blockquote>
<p>Happy to merge with date bumped to November 16th (or whatever is current when you do so), please ping me on Zulip so I can quickly hit the button.</p>
</blockquote>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> ping :) <a href="https://github.com/rust-lang/blog.rust-lang.org/pull/720">https://github.com/rust-lang/blog.rust-lang.org/pull/720</a></p>



<a name="221934067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/221934067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#221934067">(Jan 07 2021 at 12:06)</a>:</h4>
<p>Published a new progress report: <a href="https://bjorn3.github.io/2021/01/07/progress-report-dec-2020.html">https://bjorn3.github.io/2021/01/07/progress-report-dec-2020.html</a></p>



<a name="221934132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/221934132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#221934132">(Jan 07 2021 at 12:07)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> for the feedback and <span class="user-mention" data-user-id="129457">@Florian Diebold</span> for suggesting lazy compilation in jit mode.</p>



<a name="224102578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224102578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224102578">(Jan 26 2021 at 21:02)</a>:</h4>
<p>I have been working on refactoring of the abi handling in cg_clif to use the same abi calculation code as cg_llvm. It seems that the only missing thing currently is the handling of <code>PassMode::Cast</code>. Once that is done it should be possible to link crates compiled with cg_clif against crates compiled with cg_llvm. For example to optimize dependencies, but still have fast compilation of the crate you are working. I am going to continue working on it tomorrow.</p>



<a name="224102734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224102734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224102734">(Jan 26 2021 at 21:03)</a>:</h4>
<p>If you want to try it out checkout the <code>abi_compat</code> branch. It currently crashes when substracting two i128 in <a href="http://std_example.rs">std_example.rs</a> due to not yet handling <code>PassMode::Cast</code>.</p>



<a name="224535607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224535607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224535607">(Jan 29 2021 at 21:22)</a>:</h4>
<p>I got <code>PassMode::Cast</code> implemented. This doesn't help with checked 128bit ops though as they use the indirect pass mode while the intrinsic  call code expects the pair pass mode. Will fix tomorrow.</p>



<a name="224535695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224535695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224535695">(Jan 29 2021 at 21:23)</a>:</h4>
<p>Apart from the 128bit op problem nothing seems to be broken or have caused a significant runtime regression.</p>



<a name="224577736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224577736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224577736">(Jan 30 2021 at 10:08)</a>:</h4>
<p>Fixed it. <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> <span aria-label="balloon" class="emoji emoji-1f388" role="img" title="balloon">:balloon:</span> <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> I can now link cg_clif compiled crates against a cg_llvm compiled sysroot! <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> <span aria-label="balloon" class="emoji emoji-1f388" role="img" title="balloon">:balloon:</span> <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> Curiously enough for simple-raytracer it is a little slower though.</p>



<a name="224578428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224578428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224578428">(Jan 30 2021 at 10:24)</a>:</h4>
<p>Seems there is still a problem when linking a cg_llvm compiled bevy against a cg_clif compiled example game.</p>



<a name="224578678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224578678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224578678">(Jan 30 2021 at 10:30)</a>:</h4>
<p>I think it is an alignment problem for a stack value. Cranelift currently doesn't have any option to set the alignment of stack slots.</p>



<a name="224579212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224579212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224579212">(Jan 30 2021 at 10:46)</a>:</h4>
<p>Yup, alignment was the problem. Forcing all stack slots to have a size that is a multiple of 16 fixed it. It just works!!!</p>



<a name="224581142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224581142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224581142">(Jan 30 2021 at 11:36)</a>:</h4>
<p>Opened <a href="https://github.com/bjorn3/rustc_codegen_cranelift/pull/1131">https://github.com/bjorn3/rustc_codegen_cranelift/pull/1131</a></p>



<a name="224593090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224593090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224593090">(Jan 30 2021 at 16:28)</a>:</h4>
<p>Fwiw stack alignment is abi property and differs between targets</p>



<a name="224594926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224594926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224594926">(Jan 30 2021 at 17:13)</a>:</h4>
<p>This is not a problem of the alignment of the overall stack. That is already correctly handled by Cranelift. This is an individual stack slot not being aligned to 16 bytes as required because an earlier stack slot was smaller and no padding was added beyond the padding necessary to align to 8 bytes that is always applied. <a href="https://github.com/bytecodealliance/wasmtime/blob/a4eaefc6700205f5b7564d43b9f928f6c22ef15f/cranelift/codegen/src/machinst/abi_impl.rs#L592">https://github.com/bytecodealliance/wasmtime/blob/a4eaefc6700205f5b7564d43b9f928f6c22ef15f/cranelift/codegen/src/machinst/abi_impl.rs#L592</a></p>



<a name="224599454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224599454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224599454">(Jan 30 2021 at 18:59)</a>:</h4>
<p>Um, what??? All I did was re-enabling the MIR inliner for just the sysroot:</p>
<div class="codehilite"><pre><span></span><code>$ ./raytracer_cg_llvm
8101 milliseconds elapsed.
$ ../build/cargo.sh run
5371 milliseconds elapsed.
</code></pre></div>



<a name="224599586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224599586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224599586">(Jan 30 2021 at 19:01)</a>:</h4>
<p>Previously the perf win wasn't as big. I presume this win is because of <a href="https://github.com/rust-lang/rust/issues/68828">#68828</a>. It may be a good idea to enable to for the official libstd builds too. (Provided that we are confident that the MIR inliner doesn't cause miscompilations.)</p>



<a name="224600639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224600639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224600639">(Jan 30 2021 at 19:21)</a>:</h4>
<p>we still have a (pre existing but more frequently happening if MIR inlining happens) bug that I would consider a blocker: <a href="https://github.com/rust-lang/rust/issues/81403">https://github.com/rust-lang/rust/issues/81403</a></p>



<a name="224600764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224600764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224600764">(Jan 30 2021 at 19:24)</a>:</h4>
<p>I would also add <a href="https://github.com/rust-lang/rust/issues/78442">#78442</a> to the list. Running test suite with -Zmir-opt-level=2 and -Zvalidate-mir reveals a few more.</p>



<a name="224601154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224601154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224601154">(Jan 30 2021 at 19:32)</a>:</h4>
<p>ok, I'm creating a meta issue for enabling mir inlining by default (if there isn't already one, looking rn)</p>



<a name="224601413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224601413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224601413">(Jan 30 2021 at 19:38)</a>:</h4>
<p>and here we go: <a href="https://github.com/rust-lang/rust/issues/81567">https://github.com/rust-lang/rust/issues/81567</a></p>



<a name="224601435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224601435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224601435">(Jan 30 2021 at 19:39)</a>:</h4>
<p>all that said... we could still enable the inliner for bootstrap even without exposing it to users</p>



<a name="224612514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224612514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224612514">(Jan 30 2021 at 23:59)</a>:</h4>
<p>your issue lists inline(always), what effect does mir inline have on that?</p>



<a name="224612586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224612586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224612586">(Jan 31 2021 at 00:01)</a>:</h4>
<p>specifically, last i heard, currently inline(always) has the "secret" effect of being able to force an inline across a function feature boundary. This is actually very <strong>bad</strong> to do on accident. So that's one area we need to be careful with if mir inline will expand how often that happens.</p>



<a name="224612604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224612604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224612604">(Jan 31 2021 at 00:02)</a>:</h4>
<p>What is a function feature boundary?</p>



<a name="224612635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224612635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224612635">(Jan 31 2021 at 00:02)</a>:</h4>
<p>you mean across target features? I think the MIR inliner takes that into account</p>



<a name="224612650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224612650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224612650">(Jan 31 2021 at 00:02)</a>:</h4>
<p>but so does LLVM's normal inlining pass</p>



<a name="224612652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224612652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224612652">(Jan 31 2021 at 00:02)</a>:</h4>
<p>if inline(always) circumvents it that's a soundness issue</p>



<a name="224613732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224613732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224613732">(Jan 31 2021 at 00:32)</a>:</h4>
<p>It <em>is</em> a soundness issue, yes</p>



<a name="224613739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224613739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224613739">(Jan 31 2021 at 00:32)</a>:</h4>
<p><span class="user-mention" data-user-id="352985">@tm</span> A target feature such as <code>avx</code> or <code>thumb</code></p>



<a name="224613810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224613810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224613810">(Jan 31 2021 at 00:34)</a>:</h4>
<p>that is: if "this function doesn't have avx" and then you call a function with avx enabled, that's what i mean. or if you have thumb off or on and you call a function with the opposite setting.</p>



<a name="224613829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224613829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224613829">(Jan 31 2021 at 00:35)</a>:</h4>
<p>is this related to <a href="https://github.com/rust-lang/rust/issues/79865">https://github.com/rust-lang/rust/issues/79865</a> or a different issue? I can't find one that matches exactly</p>



<a name="224614279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614279">(Jan 31 2021 at 00:49)</a>:</h4>
<p>That could be related to that issue? I'm not familiar with this problem as having a specific issue, but it came up during discussion of the <code>instruction_set</code> function attribute and how it would or wouldn't interact properly with inline assembly.</p>



<a name="224614294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614294">(Jan 31 2021 at 00:49)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="143274">@Amanieu</span> if you recall back to that  i think you were the one who checked at the time if you could force an inline past a function feature barrier.</p>



<a name="224614358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614358">(Jan 31 2021 at 00:51)</a>:</h4>
<p>LLVM will inline across a feature barrier for <code>alwaysinline</code>but not normal <code>inlinehint</code>.</p>



<a name="224614422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614422">(Jan 31 2021 at 00:52)</a>:</h4>
<p>I don't think this behavior is documented anywhere though.</p>



<a name="224614446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614446">(Jan 31 2021 at 00:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/224612586">said</a>:</p>
<blockquote>
<p>specifically, last i heard, currently inline(always) has the "secret" effect of being able to force an inline across a function feature boundary. This is actually very <strong>bad</strong> to do on accident. So that's one area we need to be careful with if mir inline will expand how often that happens.</p>
</blockquote>
<p>Actually it's not so bad because then it will only use the features of the outer function when inlining. So it shouldn't cause any soundness issues, just maybe poor performance.</p>



<a name="224614505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614505">(Jan 31 2021 at 00:55)</a>:</h4>
<p>ah, okay</p>



<a name="224614509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224614509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224614509">(Jan 31 2021 at 00:55)</a>:</h4>
<p>thanks for the explanation!</p>



<a name="224615308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224615308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224615308">(Jan 31 2021 at 01:17)</a>:</h4>
<p>LLVM runs different passes for <code>alwaysinline</code> and <code>inlinehint</code>. I wouldn't be surprised if somebody adjusted/fixed the regular inliner and forgot <code>inlinealways</code> case. Or perhaps that was very intentional choice.</p>



<a name="224615375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224615375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224615375">(Jan 31 2021 at 01:18)</a>:</h4>
<p>I could go either way on this, in case its not a bug in the inliner, its just a responsibility on the front-end to make sure things are right, and in our case <code>#[inline(always)]</code> probably shouldn't become <code>inlinealways</code> in case it'd be unsound.</p>



<a name="224615456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224615456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224615456">(Jan 31 2021 at 01:20)</a>:</h4>
<p>Looks intentional: "Never inline functions with conflicting attributes (unless callee has always-inline attribute)."</p>



<a name="224615471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224615471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224615471">(Jan 31 2021 at 01:21)</a>:</h4>
<p>OTOH, at least target_feature attributes infect the definition with unsafe, so we could very well just punt the responsibility on the user here… so many options!</p>



<a name="224615612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224615612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224615612">(Jan 31 2021 at 01:25)</a>:</h4>
<p>One thing LLVM checks for that is still missing from MIR inliner is exposing returns twice functions (if this is something we want to support).</p>



<a name="224615671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224615671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224615671">(Jan 31 2021 at 01:26)</a>:</h4>
<p>ah, that'd be <a href="https://github.com/rust-lang/rust/issues/58314">https://github.com/rust-lang/rust/issues/58314</a></p>



<a name="224622595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224622595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224622595">(Jan 31 2021 at 04:53)</a>:</h4>
<p>If we just bar <code>instruction_set</code> and <code>inline(always)</code> from being used in the same function, we should be good</p>



<a name="224623304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224623304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224623304">(Jan 31 2021 at 05:08)</a>:</h4>
<p>Actually, even then, only if <code>asm!</code> is used within the function.</p>



<a name="224788053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224788053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224788053">(Feb 01 2021 at 20:44)</a>:</h4>
<p>New progress report: <a href="https://bjorn3.github.io/2021/02/01/progress-report-jan-2021.html">https://bjorn3.github.io/2021/02/01/progress-report-jan-2021.html</a></p>



<a name="224807677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224807677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224807677">(Feb 01 2021 at 23:18)</a>:</h4>
<p>For windows compat, would there be worth in me doing work to add <code>.bat</code> equivalents to the sh files?</p>



<a name="224816140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224816140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224816140">(Feb 02 2021 at 00:54)</a>:</h4>
<p>This may need some of the patches from <code>wip_windows_support3</code>, but I'm going for a native <code>windows-msvc</code> toolchain, so just to get it building I only need to drop the <code>__{register, deregister}_frame</code> fns</p>



<a name="224834228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224834228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224834228">(Feb 02 2021 at 06:43)</a>:</h4>
<p>I don't think it makes sense to add <code>.bat</code> files at least for now. They will get out of sync with the <code>.sh</code> files as they aren't tested.</p>



<a name="224857930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224857930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224857930">(Feb 02 2021 at 11:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> Given the recent improvements to cg_clif I think it may make sense to start distributing it using rustup on the nightly channel just like miri. How would I make this happen?</p>



<a name="224858127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/224858127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#224858127">(Feb 02 2021 at 11:23)</a>:</h4>
<p>Ah, let me fork off a thread</p>



<a name="234305496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/234305496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#234305496">(Apr 13 2021 at 11:04)</a>:</h4>
<p>New progress report: <a href="https://bjorn3.github.io/2021/04/13/progress-report-april-2021.html">https://bjorn3.github.io/2021/04/13/progress-report-april-2021.html</a></p>



<a name="246387436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/246387436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#246387436">(Jul 18 2021 at 16:46)</a>:</h4>
<p>Finally!!! <a href="https://github.com/rust-lang/rust/pull/81746#issuecomment-882084357">https://github.com/rust-lang/rust/pull/81746#issuecomment-882084357</a> <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> <span aria-label="confetti" class="emoji emoji-1f38a" role="img" title="confetti">:confetti:</span> <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="246387445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/246387445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#246387445">(Jul 18 2021 at 16:47)</a>:</h4>
<p>tl;dr: dist of cg_clif finally works on windows</p>



<a name="246388224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/246388224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#246388224">(Jul 18 2021 at 17:03)</a>:</h4>
<p>it will be awesome to finally get cg_clif on nightly via rustup. congrats on getting this working ! (also: thanks a whole lot for all the incredible work :)</p>



<a name="246403710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/246403710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#246403710">(Jul 18 2021 at 23:05)</a>:</h4>
<p>Outstanding work! I look forward to being able to use it on nightly. And notably adding a run for CI, given that I have caught a bug before.</p>



<a name="248514433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/cranelift%20backend%20work/near/248514433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/cranelift.20backend.20work.html#248514433">(Aug 05 2021 at 18:10)</a>:</h4>
<p>Published another progress report: <a href="https://bjorn3.github.io/2021/08/05/progress-report-july-2021.html">https://bjorn3.github.io/2021/08/05/progress-report-july-2021.html</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>